﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using DC2010.Objects.Base;

namespace DC2010.Objects
{
    /// <summary>
    /// If there is anything u want to display in dungeon viewport u have to know where exactly object is.
    /// 
    /// Items/Monsters/etc can be on the FLOORS / WALLS
    /// - 5 positions on the floor
    /// 
    /// - Center
    /// - FrontRight
    /// - FrontLeft
    /// - DistRight
    /// - DistLeft
    /// 
    /// 
    /// I-------------I
    /// I  DL  I  DR  I
    /// I  ---------  I
    /// I--I   C   I--I
    /// I  ---------  I
    /// I  FL  I  FR  I
    /// I-------------I
    /// 
    /// point of view (standing here)
    /// 
    /// There will exist five interactive parts in dungeon view
    /// 
    /// 1. Square in front of u. In case it is floor. This rectangles whould be perspective...but
    /// 2. Square in front of u. In case it is wall. This shoud be easy
    /// 3. Left wall in front of u (-1,-1)
    /// 4. Right wall in front of u (-1,1)
    /// 5. 0 position to the left
    /// 6. 0. position to the right
    /// 
    /// There also have to be non interactive equivalent for greater distances...places we cannot reach
    /// Those rectangles will be pre-calculated.
    /// 
    /// CENTER of view
    /// </summary>
    public class DungeonPlacement : ICloneable
    {
        /// <summary>
        /// Determine what object type is referenced object
        /// </summary>
        public BaseObjectType ObjectType { get; set; }

        /// <summary>
        /// Link to object
        /// </summary>
        public string ObjectId { get; set; }

        /// <summary>
        /// Where is object placed specifically
        /// </summary>
        public ObjectPosition ObjectPosition { get; set; }

        /// <summary>
        /// Temp object which will be instanced but not serialized. Helper object.
        /// </summary>
        private object TempObject { get; set; }

        [XmlIgnore]
        public object Tag { get; set; }

        public bool IsWallObject { get; set; }
        public bool IsFloorObject { get; set; }

        #region ICloneable Members

        public object Clone()
        {
            return this.MemberwiseClone();
        }

        #endregion
    }
}
